Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests_Import_Parser::test_blank_lines_in_content(): minor test fix #169

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Sep 13, 2024

Depending on how a git repo is cloned, files may have *nix line endings or Windows line endings. Now, as this test uses a file based fixture, this has an impact on the tests.

As things are, the test basically assumes that core.autocrlf=true (change line endings based on the OS) is used, while that is an assumption which cannot be made.

This can lead to confusion for contributors when they are confronted by an inexplicably failing test.

As the Windows line ending \r\n includes the *nix line ending \n anyway, changing the test to just check for the count of the \n characters maintains the value of the test, while preventing test failures for contributors who run the test on Windows and check out with core.autocrlf=input.

Depending on how a git repo is cloned, files may have *nix line endings or Windows line endings.
Now, as this test uses a file based fixture, this has an impact on the tests.

As things are, the test basically assumes that `core.autocrlf=true` (change line endings based on the OS) is used, while that is an assumption which cannot be made.

This can lead to confusion for contributors when they are confronted by an inexplicably failing test.

As the Windows line ending `\r\n` includes the *nix line ending `\n` anyway, changing the test to just check for the count of the `\n` characters maintains the value of the test, while preventing test failures for contributors who run the test on Windows and check out with `core.autocrlf=input`.
Copy link
Member

@swissspidy swissspidy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@swissspidy swissspidy merged commit c569384 into master Oct 1, 2024
26 checks passed
@swissspidy swissspidy deleted the feature/fix-test-for-cross-os branch October 1, 2024 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants